(function() {
    'use strict';
    angular
        .module('milkbeeApp')
        .factory('PubCardCategory', PubCardCategory)
        .factory('PubCardComments', PubCardComments)
        .factory('PubCardRecomments', PubCardRecomments)
        .factory('PubCardEssences', PubCardEssences);

    PubCardCategory.$inject = ['$resource', 'DateUtils'];
    PubCardComments.$inject = ['$resource', 'DateUtils'];
    PubCardRecomments.$inject = ['$resource', 'DateUtils'];
    PubCardEssences.$inject = ['$resource', 'DateUtils'];

    function PubCardCategory ($resource, DateUtils) {
    	var resourceUrl =  'api/pub/card/category/:categoryId';   	
    	return $resource(resourceUrl, {}, {
    		'query': { method: 'GET', isArray: true}	
    	});
    }
    
    
    function PubCardComments ($resource, DateUtils) {
    	var resourceUrl =  'api/pub/card/comments/:cardId';
    	return $resource(resourceUrl, {}, {
    		'query': { method: 'GET', isArray: true}	
    	});
    }
    
    function PubCardRecomments($resource, DateUtils){
    	var resourceUrl =  'api/pub/card/recommends/:count';
    	return $resource(resourceUrl, {}, {
    		'query': { method: 'GET', isArray: true}	
    	});
    }
    function PubCardEssences($resource, DateUtils){
    	var resourceUrl =  'api/pub/card/essences/:count';
    	return $resource(resourceUrl, {}, {
    		'query': { method: 'GET', isArray: true}	
    	});
    }
    
})();
